﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NewsManager.ascx.cs"
    Inherits="CMS.Controls.News.NewsManager1" %>
<%@ Import Namespace="Core.Library" %>
<%@ Import Namespace="DataObject.News" %>
<asp:HiddenField ID="hfTab" runat="server" />
<asp:HiddenField ID="hfStatus" runat="server" />
<div class="stats">
    <ul>
        <li><a title="" class="count green" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsPublished.ToString()) %>">
            <%= Publish %></a><span>Xuất bản</span></li>
        <li><a title="" class="count orange" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsWaitingForPublish.ToString()) %>">
            <%= WaitingForPublish %></a><span>Chờ duyệt</span></li>
        <li><a title="" class="count grey" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsDraft.ToString()) %>">
            <%= Draft %></a><span>Lưu tạm</span></li>
        <li class="last"><a title="" class="count red" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsRemoved.ToString()) %>">
            <%= Removed %></a><span>Đã gỡ</span></li>
    </ul>
    <div class="fix">
    </div>
</div>
<!-- /stats -->
<asp:Literal ID="ltMessage" runat="server" />
<!-- /message -->
<div class="widget" style="margin-top: 20px">
    <ul class="tabs">
        <li id="tab8"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsPublished.ToString()) %>">
            Bài đã xuất bản</a></li>
        <li id="tab2"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsWaitingForPublish.ToString()) %>">
            Bài chờ duyệt</a></li>
        <li id="tab1"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsDraft.ToString()) %>">
            Bài lưu tạm</a></li>
        <li id="tab16"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsRemoved.ToString()) %>">
            Bài đã gỡ</a></li>
        <li id="tab32"><a href="<%= UrlHelpers.CreateNews(Url) %>">Viết bài mới</a></li>
    </ul>
    <div class="tab_container">
        <div class="tab_content">
            <div class="floatleft">
                <div class="searchWidget">
                    <input id="txtStartDate" type="text" class="floatleft mr5 datepicker" placeholder="Từ ngày"
                        value="Từ ngày" style="width: 60px; height: 20px" runat="server" />
                    <input id="txtEndDate" type="text" class="floatleft mr5 datepicker" placeholder="Đến ngày"
                        value="Đến ngày" style="width: 60px; height: 20px" runat="server" />
                    <input id="txtKeyword" type="text" placeholder="Từ khóa" style="width: 200px; height: 20px"
                        runat="server" />
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" />
                </div>
            </div>
            <div class="floatright">
                <asp:Button ID="btnSend" Text="Gửi chờ xuất bản" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnSend" runat="server" />
                <asp:Button ID="btnPublish" Text="Xuất bản" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnPublish" runat="server" />
                <asp:Button ID="btnRestore" Text="Phục hồi" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnRestore" runat="server" />
                <asp:Button ID="btnRemove" Text="Gỡ bài viết" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 redBtn" OnClick="BtnRemove" runat="server" />
                <asp:Button ID="btnDelete" Text="Xóa bài viết" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 redBtn" OnClick="BtnDelete" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');"
                    runat="server" />
            </div>
            <div class="fix">
            </div>
            <asp:ListView ID="lvList" DataKeyNames="News_ID" OnItemDataBound="lvList_ItemDataBound"
                runat="server">
                <LayoutTemplate>
                    <div class="widget" style="margin-top: 10px">
                        <table id="grdList" width="100%" cellspacing="0" cellpadding="0" class="tableStatic">
                            <thead>
                                <tr>
                                    <td class="pl10 w30">
                                        <input id="cbAll" type="checkbox" onclick="selectAllRows(this);" />
                                    </td>
                                    <td class="w45">
                                        STT
                                    </td>
                                    <td>
                                        Tiêu đề
                                    </td>
                                    <td class="w80">
                                        Tác giả
                                    </td>
                                    <td class="w80">
                                        Sửa cuối
                                    </td>
                                    <td class="w80">
                                        Phê duyệt
                                    </td>
                                    <td class="w125">
                                        Ngày xuất bản
                                    </td>
                                    <td class="w100">
                                        Thao tác
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr id="itemPlaceHolder" runat="server">
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr id="<%# ((NewsObject)Container.DataItem).News_ID %>-list">
                        <td class="aligncenter">
                            <asp:CheckBox ID="cbItem" ClientIDMode="Static" runat="server" />
                        </td>
                        <td class="aligncenter">
                            <%# Utils.GetStt(ConvertUtility.ConvertTo<int>(Container.DataItemIndex), PageIndex, PageSize)%>
                        </td>
                        <td>
                            <a href="<%# UrlHelpers.EditNews(((NewsObject)Container.DataItem).News_ID.ToString(), Url) %>">
                                <%# ((NewsObject)Container.DataItem).News_Title %>
                        </td>
                        </a>
                        <asp:Literal ID="ltImage" runat="server" />
                        </td>
                        <td class="aligncenter">
                            <%# ((NewsObject)Container.DataItem).News_CreatedBy %>
                        </td>
                        <td class="aligncenter">
                            <%# ((NewsObject)Container.DataItem).News_EditedBy %>
                        </td>
                        <td class="aligncenter">
                            <%# ((NewsObject)Container.DataItem).News_ApprovedBy %>
                        </td>
                        <td class="aligncenter">
                            <%# DateTimeFunctions.FormatIn_HHMM_DDMMYYYY(ConvertUtility.ToDateTime(((NewsObject)Container.DataItem).News_PublishDate))%>
                        </td>
                        <td class="aligncenter">
                            <a class="btn14 topDir" title="Sửa" href="<%# UrlHelpers.EditNews(((NewsObject)Container.DataItem).News_ID.ToString(), Url) %>">
                                <img src="/images/icons/dark/pencil.png" alt="" />
                            </a>
                        </td>
                    </tr>
                    <asp:HiddenField ID="hfStatus" Value='<%# ((NewsObject)Container.DataItem).News_Status %>'
                        runat="server" />
                </ItemTemplate>
                <EmptyDataTemplate>
                    <div style="width: 99%; margin: auto; padding-top: 5px;">
                        <%= MessageUtility.NoData %></div>
                </EmptyDataTemplate>
            </asp:ListView>
            <!-- /list -->
            <div class="body clear mb22">
                <div class="floatleft">
                    <label>
                        Số bản ghi / trang:</label>
                    <asp:DropDownList ID="ddlPageSize" runat="server" Width="60" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                        <asp:ListItem Text="20" Value="20" />
                        <asp:ListItem Text="40" Value="40" />
                        <asp:ListItem Text="60" Value="60" />
                        <asp:ListItem Text="80" Value="80" />
                        <asp:ListItem Text="100" Value="100" />
                    </asp:DropDownList>
                </div>
                <div class="pagination floatright">
                    <ul class="pages">
                        <asp:Literal ID="ltPager" runat="server" />
                    </ul>
                </div>
            </div>
            <div class="fix">
            </div>
            <!-- /pager -->
        </div>
    </div>
    <div class="fix">
    </div>
</div>
<!-- /tabs two zodiac -->
<script type="text/javascript">
    activeTab('<%= Tab %>');
</script>
<!-- Right Click Context Menu -->
<asp:Literal ID="ltContextMenu" runat="server" />
